package com.example.temp.demo;

import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

public class UIHelper {
	public static int dpToPx(int dp) {
		return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, App.getInstance().getResources()
				.getDisplayMetrics());
	}

	public static void setLayoutParamsWidthMatchHeightWrap(View view) {
		view.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	}
}
